package api

import (
	"FeedXmh/app/dao"
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/net/ghttp"
)

var Device_define = device_define{}

type device_define struct {
}

func (a *device_define) Get(r *ghttp.Request) {
	res := g.Map{
		"code": 0,
		"msg":  "",
		"data": nil,
	}

	list, err := dao.T_device_define.GetList()

	if err != nil {
		res["code"] = -1
		res["msg"] = err.Error()
	} else {
		res["code"] = 0
		res["data"] = list
	}
	r.Response.WriteJson(res)
	r.ExitAll()
}